cc.Class({
    extends: cc.Component,

    properties: {
        arrow: cc.Node,
        tank: cc.Node,
        msg: cc.Label
    },

    // use this for initialization
    onLoad: function () {
        this.moving = false
        this.d = false
        cc.director.getCollisionManager().enabled = true

        this.node.on('touchstart', this.start1, this)
        this.node.on('destroyed', this.destroyed, this)
    },
    start1(e) {
        cc.log(e.getLocation())
        this.moving = true
    },
    destroyed(e) {
        this.d = e.detail
    },
    update() {
        if (!this.d)
            if (this.moving)
                this.arrow.x += 5
    }

});
